dhcpv6-ia: add missing limits header
authorÁlvaro Fernández Rojas <[email protected]>
Fri, 14 Nov 2025 16:42:35 +0000 (17:42 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Fri, 14 Nov 2025 21:54:26 +0000 (22:54 +0100)
Fix the following build error by including <limits.h>:
src/dhcpv6-ia.c: In function 'handle_addrlist_change':
src/dhcpv6-ia.c:495:53: error: 'INT_MAX' undeclared (first use in this function)
  495 |                                         a->fr_cnt = INT_MAX;
      |                                                     ^~~~~~~
src/dhcpv6-ia.c:33:1: note: 'INT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
   32 | #include <libubox/md5.h>
  +++ |+#include <limits.h>
   33 |
src/dhcpv6-ia.c:495:53: note: each undeclared identifier is reported only once for each function it appears in
  495 |                                         a->fr_cnt = INT_MAX;
      |                                                     ^~~~~~~

Fixes: 7136fbe390a5 ("dhcpv6-ia: split statefile handling to separate file")
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/311
src/dhcpv6-ia.c

index 209c367c8ab628b68f36ba67e1047e49defefa66..4b11b5716c762637e64a2ee420e647195ae26084 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <time.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <stdio.h>
 #include <resolv.h>
 #include <stdlib.h>